package com.jetlion.system.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;

public class MyReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Bundle extras = intent.getExtras();

        int curBarray = extras.getInt("level");

        int totalBarray = extras.getInt("scale");

        if(curBarray*1.0/totalBarray<0.2){
            Toast.makeText(context,"电池电量低，请充电",Toast.LENGTH_SHORT).show();
        }

    }
}
